home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / emacssrc.zip / EMACSSRC.TAR / emacs-19.17 / src / disptab.h < prev    next >
C/C++ Source or Header  |  1993-10-06  |  3KB  |  85 lines

  1. /* Things for GLYPHS and glyph tables.
  2.    Copyright (C) 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU Emacs.
  5.  
  6. GNU Emacs is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GNU Emacs is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU Emacs; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* Access the slots of a display-table, according to their purpose.  */
  21.  
  22. #define DISP_TABLE_SIZE 261
  23. #define DISP_TRUNC_GLYPH(dp) ((dp)->contents[256])
  24. #define DISP_CONTINUE_GLYPH(dp) ((dp)->contents[257])
  25. #define DISP_ESCAPE_GLYPH(dp) ((dp)->contents[258])
  26. #define DISP_CTRL_GLYPH(dp) ((dp)->contents[259])
  27. #define DISP_INVIS_VECTOR(dp) ((dp)->contents[260])
  28. #define DISP_CHAR_VECTOR(dp, c) ((dp)->contents[c])
  29.  
  30. /* Display table to use for vectors that don't specify their own.  */
  31. extern Lisp_Object Vstandard_display_table;
  32.  
  33. /* Vector of GLYPH definitions.  Indexed by GLYPH number,
  34.    the contents are a string which is how to output the GLYPH.  */
  35. extern Lisp_Object Vglyph_table;
  36.  
  37. /* Return the current length of the GLYPH table,
  38.    or 0 if the table isn't currently valid.  */
  39. #define GLYPH_TABLE_LENGTH  \
  40.   ((XTYPE (Vglyph_table) == Lisp_Vector) \
  41.    ? XVECTOR (Vglyph_table)->size : 0)
  42.  
  43. /* Return the current base (for indexing) of the GLYPH table,
  44.    or 0 if the table isn't currently valid.  */
  45. #define GLYPH_TABLE_BASE  \
  46.   ((XTYPE (Vglyph_table) == Lisp_Vector) \
  47.    ? XVECTOR (Vglyph_table)->contents : 0)
  48.  
  49. /* Given BASE and LEN returned by the two previous macros,
  50.    return nonzero if the GLYPH code G should be output as a single
  51.    character with code G.  Return zero if G has a string in the table.  */
  52. #define GLYPH_SIMPLE_P(base,len,g)  \
  53.   ((g) >= (len) || XTYPE (base[g]) != Lisp_String)
  54.  
  55. /* Given BASE and LEN returned by the two previous macros,
  56.    return nonzero if GLYPH code G is aliased to a different code.  */
  57. #define GLYPH_ALIAS_P(base,len,g)  \
  58.   ((g) < (len) && XTYPE (base[g]) == Lisp_Int)
  59.  
  60. /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 1,
  61.    return the alias for G.  */
  62. #define GLYPH_ALIAS(base, g) XINT (base[g])
  63.  
  64. /* Follow all aliases for G in the glyph table given by (BASE,
  65.    LENGTH), and set G to the final glyph.  */
  66. #define GLYPH_FOLLOW_ALIASES(base, length, g)                \
  67.   while (GLYPH_ALIAS_P ((base), (length), (g)))                \
  68.     (g) = GLYPH_ALIAS ((base), (g));
  69.   
  70. /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0,
  71.    return the length and the address of the character-sequence
  72.    used for outputting GLYPH G.  */
  73. #define GLYPH_LENGTH(base,g)   XSTRING (base[g])->size
  74. #define GLYPH_STRING(base,g)   XSTRING (base[g])->data
  75.  
  76. /* GLYPH for a space character.  */
  77.  
  78. #define SPACEGLYPH 040
  79. #define NULL_GLYPH 00
  80.  
  81. #define GLYPH_FROM_CHAR(c) (c)
  82.  
  83. #include "print_p.h"
  84. #include "window_p.h"
  85.